//
//  ServiceRequest.h
//  BDD_TWO
//
//  Created by WangZhenyu on 2018/11/21.
//  Copyright © 2018 WangZhenyu. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef void(^SizeBlock)(long long size);

@interface ServiceRequest : NSObject


+(instancetype)sharedService;

- (void)GET:(NSString *)URLString parameters:(id)parameters success:(void (^)(id responseObject))success failure:(void (^)(NSString *error, NSInteger code))failure;

- (void)GET:(NSString *)URLString parameters:(id)parameters progrcess:(void (^)(NSProgress *downloadProgress))progress success:(void (^)(id responseObject))success failure:(void (^)(NSString *error, NSInteger code))failure;

- (void)GETCUSTOM:(NSString *)URLString parameters:(id)parameters success:(void (^)(id responseObject))success failure:(void (^)(NSString *error, NSInteger code))failure;

- (void)POST:(NSString *)URLString parameters:(id)parameters success:(void (^)(id responseObject))success failure:(void (^)(NSString *error, NSInteger code))failure;

- (void)POSTCUSTOM:(NSString *)URLString parameters:(id)parameters success:(void (^)(id))success failure:(void (^)(NSString *, NSInteger code))failure;

- (void)PUT:(NSString *)URLString parameters:(id)parameters success:(void (^)(id responseObject))success failure:(void (^)(NSString *error, NSInteger code))failure;

- (void)PUTJSON:(NSString *)URLString parameters:(id)parameters success:(void (^)(id))success failure:(void (^)(NSString *, NSInteger code))failure;

- (void)DELETE:(NSString *)URLString parameters:(id)parameters success:(void (^)(id responseObject))success failure:(void (^)(NSString *error, NSInteger code))failure;

- (void)DELETEJSON:(NSString *)URLString parameters:(id)parameters success:(void (^)(id))success failure:(void (^)(NSString *error, NSInteger code))failure;

- (void)POSTJSON:(NSString *)URLString parameters:(id)parameters success:(void (^)(id responseObject))success failure:(void (^)(NSString *error, NSInteger code))failure;

- (void)POSTJSON:(NSString *)URLString parameters:(id)parameters success:(void (^)(id responseObject))success failure:(void (^)(NSString *error, NSInteger code))failure update:(void (^)(float progress))update;

- (void)POSTJSONCUSTOM:(NSString *)URLString parameters:(id)parameters success:(void (^)(id))success failure:(void (^)(NSString *, NSInteger code))failure;

- (void)POSTJSONSTRING:(NSString *)URLString withJsonStr:(NSString *)str success:(void (^)(id responseObject))success failure:(void (^)(NSString *error, NSInteger code))failure;

- (void)POSTJSONSTRING:(NSString *)URLString withJsonStr:(NSString *)str progrcess:(void (^)(NSProgress *downloadProgress))progress success:(void (^)(id responseObject))success failure:(void (^)(NSString *error, NSInteger code))failure;

- (void)PUTJSON:(NSString *)URLString parameters:(id)parameters success:(void (^)(id responseObject))success failure:(void (^)(NSString *error, NSInteger code))failure update:(void (^)(float progress))update;

- (void)cancelDataTaskForKey:(NSString *)key;

- (void)URLFileSizeWidthURL:(NSString *)URL fileSize:(SizeBlock)fileSize;

- (void)showLoginAlertView;
- (void)showVipAlertView:(NSString *)errorStr;
@end
